<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="java.util.Map" %>
<%@page import="java.math.BigDecimal" %>
<%@page import="java.text.DecimalFormat" %>
<%@include file="headProd.jsp" %>
<div id="page">
    <% Map<String,Object> prod = (Map<String,Object>) request.getAttribute("producte"); 
       DecimalFormat formatter = new DecimalFormat("#####0.00");
    %>
    <div class="prodDet">
        <div class="nom"><%=prod.get("nom") %></div><hr />
        <div class="img"><img alt="pepitu" src="productes?id=<%=request.getAttribute("idProducte") %>&op=2" /></div>
        <div class="descripcio"><%=prod.get("descripcio") %></div>
        <div class="preu">
            <% if (((BigDecimal)prod.get("stock")).intValue() > 0) { %>
            <img src="imatges/in-stock.gif" alt="In Stock" />
            <%}%>
            Preu: <span><%=formatter.format(prod.get("preu")) %>&euro;</span>
        </div>
        <div class="addcar">
            <form method="post" action="usuaris">
                <input type="hidden" value="4" name="op" />
                <input type="hidden" value="<%=request.getAttribute("idProducte") %>" name="id" />
                <input type="submit" class="boto" value="Afegeix" />
                <input type="text" name="num" value="1" maxlength="4"/>
            </form>
        </div>
        <div id="puntuacio" value="<%=request.getAttribute("idProducte") %>">
             <%@include file="puntuacioProd.jsp" %>
        </div>
    </div>

    <div id="comments" value="<%=request.getAttribute("idProducte") %>">
        <%@include file="commentProd.jsp" %>
    </div>
</div>